package cn.itcast.bos.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.take_delivery.WayBill;

public interface WayBillRepository extends JpaRepository<WayBill,Integer>,JpaSpecificationExecutor<WayBill> {

	WayBill findByWayBillNum(String wayBillNum);

	@Query(value="select count(t.signStatus),CASE WHEN t.signStatus=1 THEN '待发货' WHEN t.signStatus=2 THEN '派送中' WHEN t.signStatus=3 THEN '已签收' ELSE'异常' END  from  WayBill t group by t.signStatus order by t.signStatus asc")
	List<Object[]> findBySignStatus();


}
